package boot.dao;

import boot.domain.Product;
import boot.domain.ProductDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author enthalpy
 * @since 2022-10-28
 */
@Mapper
public interface ProductDao extends BaseMapper<Product> {
    @Select("SELECT * FROM product")
    @Results({@Result(id = true, property = "id", column = "id"),
            @Result(property = "supplierList", column = "id",
                    many = @Many(select = "boot.dao.SupplierDao.getSuppliersById"))
    })
    List<ProductDto> findAllProductVo();
}
